# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

_realname=gnome-doc-utils

pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=0.20.10
pkgrel=1
pkgdesc="A Collection of Documentation Utilities for GNOME (mingw-w64)"
arch=('any')
url="https://www.gtk.org/gtk-doc/"
license=("GPL" "FDL")
options=(staticlibs strip)
depends=("${MINGW_PACKAGE_PREFIX}-docbook-xml"
    "${MINGW_PACKAGE_PREFIX}-libxslt"
    "${MINGW_PACKAGE_PREFIX}-python2"
    )
makedepends=(
    'intltool'
    )
optdepends=(#"${MINGW_PACKAGE_PREFIX}-jade: SGML support"
            #"${MINGW_PACKAGE_PREFIX}-dblatex: PDF support"
      )
url="https://www.gnome.org/"
source=(https://download.gnome.org/sources/${_realname}/${pkgver%.*}/${_realname}-${pkgver}.tar.xz)
sha256sums=('cb0639ffa9550b6ddf3b62f3b1add92fb92ab4690d351f2353cffe668be8c4a6')

build() {
  mkdir -p "${srcdir}/build-${CHOST}"
  cd "${srcdir}/build-${CHOST}"
  #export PYTHON=/usr/bin/python2
  #export XMLCATALOG=/usr/bin/xmlcatalog
  PYTHON=${MINGW_PREFIX}/bin/python2 \
  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${CHOST} \
    --host=${CHOST} \
    --sysconfdir=${MINGW_PREFIX}/etc --mandir=${MINGW_PREFIX}/share/man \
    --localstatedir=${MINGW_PREFIX}/var --disable-scrollkeeper
  make
}

package() {
  cd "${srcdir}/build-${CHOST}"
  make DESTDIR="$pkgdir" install
}